import pygame
import gui
import psyco
from pygo1963.view.Menu import Menu
from pygo1963.view.View import View, GameView
from pygo1963.model.Player import AlphaBetaPlayer
from pygo1963.model.DepthManager import DepthManager
from pygo1963.goLogic.GoEvaluator import AdvacedGoEvaluator
from pygo1963.model.Board import Board
from pygo1963.model.Game import Game

psyco.full()
pygame.init()

def view_loop(view):
    
    run = True

    while run:
        view.clock.tick()    
        events = gui.setEvents(pygame.event.get())
        
        for e in events:
            if e.type == pygame.QUIT:
                run = False
                    
        view.update()
        view.desktop.events = events
        view.draw()        
        
        pygame.display.flip()

    pygame.quit()


if __name__ == "__main__":
    
    the_view = View()
    Menu(the_view)    
    view_loop(the_view)
